import { App } from 'vue'

import { sayHello, SayHello } from './src/say-hello'
import { post, Post } from './src/ajax'

interface Utils {
  sayHello: SayHello,
  post: Post
}

const utils: Utils = {
  sayHello,
  post
}

declare module '@vue/runtime-core' {
  interface ComponentCustomProperties {
    $utils: Utils
  }
}

export default {
  install(app: App) {
    app.config.globalProperties.$utils = utils
  }
}